import { Injectable } from '@nestjs/common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';
import { EvaluationProjectModel } from './evaluation-project.model';

@Injectable()
export class EvaluationProjectService {
  constructor(
    @InjectRepository(EvaluationProjectModel)
    private readonly evaluationProjectModelRepository: Repository<EvaluationProjectModel>,
  ) {}

  async all(): Promise<EvaluationProjectModel[]> {
    return this.evaluationProjectModelRepository.find({
      select: ['uuid', 'name', 'desc', 'sort','rule','type', 'code'],
      order: {
        sort: 'ASC',
        id: 'DESC',
      },
    });
  }
}
